package com.big.merchan.controller.api;

import com.big.common.result.Result;
import com.big.merchan.service.MerchandiseSpecificationPackageService;
import com.big.model.model.merchandise.MerchandiseSpecification;
import com.big.model.model.merchandise.MerchandiseSpecificationPackage;
import com.big.model.vo.merchandise.SpecificationPackageVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/merchan/specificationPackage")
public class MerchandiseSpecificationPackageController {


    @Autowired
    MerchandiseSpecificationPackageService specificationPackageService;


    //规格价格组
    @ApiOperation(value = "商品规格详情")
    @GetMapping("/packages/{mId}")
    public Result packages(@PathVariable("mId") String mId){
        SpecificationPackageVo merchandiseSpecificationPackages = specificationPackageService.speciFicationPackages(mId);
        return Result.ok(merchandiseSpecificationPackages);
    }

    /**
     * 查单套餐
     */

    @ApiOperation(value = "查单套餐")
    @GetMapping("/findPackage/{mId}")
    public MerchandiseSpecificationPackage  findSpecificationPackage(@PathVariable("mId") String mId){
        MerchandiseSpecificationPackage specificationPackage = specificationPackageService.findSpecificationPackage(mId);
        return  specificationPackage;
    }


}
